package GUI.Panels.GameObjectPanels;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.ActionListener;

import javax.swing.JTextArea;

import GUI.GameScreen;
import GUI.Panels.GameObjectPanels.ShipPanels.ShipPanel;

public class SheildPanel extends ObjectPanel 
{
	private static final long serialVersionUID = 1L;
	private final JTextArea txt = new JTextArea();
	
	public SheildPanel(ActionListener actionListener, double energy)
	{
		addPanels(actionListener, energy);
	}
	
	public void addPanels(ActionListener actionListener, double energy)
	{
		txt.setPreferredSize(new Dimension(ShipPanel.SHEILD_WIDTH, ShipPanel.SHEILD_HEIGHT));
		txt.setText("Energy Level: "+energy);
		txt.setLineWrap(true);
		this.txt.setEditable(false);
		this.add(txt, BorderLayout.NORTH);
	}
	
	public void update(double energy)
	{
		this.txt.setText("Energy Level: "+energy);	
	}
}
